<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    
    <div class="form-group">
        {if($supplier)}
            <!-- 供应商 -->
            <label class="control-label col-xs-12 col-sm-1">{:__('Supplierid')}:</label>
            <div class="col-xs-12 col-sm-2">
                <input id="c-supplierid" class="form-control" type="text" readonly value="{$supplier.name|htmlentities}">
                <input type="hidden" name="row[supplierid]" id="supplierid" value="{$supplier.id|htmlentities}">
            </div>

            <label class="control-label col-xs-12 col-sm-1">{:__('Mobile')}:</label>
            <div class="col-xs-12 col-sm-2">
                <input id="c-mobile" min="0" class="form-control" name="row[mobile]" type="text" readonly value="{$supplier.mobile|htmlentities}">
            </div>
            
            <!-- 地址 -->
            <label class="control-label col-xs-12 col-sm-1">{:__('Region')}:</label>
            <div class="col-xs-12 col-sm-3">
                <div class='control-relative'>
                    <input id="c-Region" class="form-control" readonly type="text" value="{$supplier.districts.code|htmlentities}">
                </div>
            </div>
        {/if}

        <!-- 退货单的客户信息 -->
        {if(!$supplier)}
            <label class="control-label col-xs-12 col-sm-1">订单号</label>
            <div class="col-xs-12 col-sm-2">
                <input type="text" class="form-control" value="{$back.ordercode|htmlentities}" disabled>
            </div>

            <label class="control-label col-xs-12 col-sm-1">退货单号</label>
            <div class="col-xs-12 col-sm-2">
                <input type="text" class="form-control" value="{$back.code|htmlentities}" disabled>
            </div>

            <label class="control-label col-xs-12 col-sm-1">客户</label>
            <div class="col-xs-12 col-sm-2">
                <input type="text" class="form-control" value="{$back.business.nickname|htmlentities}" disabled>
            </div>
        {/if}

        <!-- 商品数据 -->
        <input type="hidden" name="row[product]" id="products" >

        <!-- 商品总价 -->
        <input type="hidden" name="row[total]" id="total" value="{$row.amount|htmlentities}">

        <!-- 删除商品的id -->
        <input type="hidden" name="row[delproid]" id="delproid">

        
    </div>

    {if(!$supplier)}
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-1">联系人以及地址</label>
            <div class="col-xs-12 col-sm-8">
                <input type="text" class="form-control" value="联系人：{$back.contact|htmlentities} 手机号：{$back.phone|htmlentities} 地址：{$back.province_text|htmlentities}-{$back.city_text|htmlentities}-{$back.district_text|htmlentities} {$back.address|htmlentities}" disabled>
            </div>
        </div>
    {/if}
    
    <div class="form-group">
        <!-- 入库类型 -->
        <label class="control-label col-xs-12 col-sm-1">{:__('Type')}:</label>
        <div class="col-xs-12 col-sm-2">  
            <select  id="c-type" class="form-control selectpicker" name="row[type]">
                {foreach name="typeList" item="vo"}
                    <option value="{$key}" {in name="key" value="$row.type|htmlentities"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>
        </div>

        <!-- 总价 -->
        <!-- <label class="control-label col-xs-12 col-sm-1">{:__('Amount')}:</label>
        <div class="col-xs-12 col-sm-2">
            <input id="c-amount" min="0" class="form-control" step="0.01" name="row[amount]" readonly type="number" value="0.00">
        </div> -->
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-1">{:__('Remark')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-remark" class="form-control " rows="5" name="row[remark]" cols="50">{$row.remark|htmlentities}</textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-1">
            <button type="button" class="btn btn-primary" id="product">添加商品</button>
        </label>
    </div>
    
    <div class="form-group">
        <table id="table" class="table table-striped table-bordered table-hover table-nowrap col-sm-10 control-label">
        </table>
    </div>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
